package com.insideClass.AnonymityInsideClass;

class Buildiing{

}
class House extends Buildiing{

}

/**
 * @author 13699
 */
public class ClassTypeCapture<T> {
    Class<T> kind;

    public ClassTypeCapture(Class<T> kind) {
        this.kind = kind;
    }
    public boolean f(Object arg){
        return kind.isInstance(arg);
    }

    public static void main(String[] args) {
        ClassTypeCapture<Buildiing> cttl=new ClassTypeCapture<>(Buildiing.class);
        System.out.println(cttl.f(new Buildiing()));
        System.out.println(cttl.f(new House()));
        ClassTypeCapture<House> ctt2=new ClassTypeCapture<>(House.class);
        System.out.println(ctt2.f(new Buildiing()));
        System.out.println(ctt2.f(new House()));
    }
}
